package com.clay.net.connecter.model
{
	
	
	/**
	 * 传门用于传输类; 
	 * @author crl;
	 * 
	 */	
	public class BaseJVO
	{
		public function BaseJVO()
		{
		}
		public function toJson():Object{
			var variablesInfo:VariablesInfo=DescribeTypeCache.describeType(this).variablesInfo;
			var propertys:Array=variablesInfo.getPropertys();
			var o:Object={};
			for each(var pro:String in propertys){
			
			//不存在的值不传;
			if(this[pro]==null)continue;
			o[pro]=this[pro];
			}
			
			return o;
			
			//throw new Error("BaseJVO 不提供方法实现,必须自己重写");
		}
		
		public function parseJson(data:Object):*{
			for(var pro:String in data){
				if(this.hasOwnProperty(pro)){
					this[pro]=data[pro];
				}
			}
			
			return this;
		}
		
	}
}